﻿using System;
using System.Collections.Generic;
using System.Linq;

public static class GuidExt
{

    public static Guid ZeroGuid(this Guid that)
    {
        return new Guid();
    }

    public static Guid ZeroGuid()
    {
        return new Guid();
    }

    public static bool CheckGuid(string guidString)
    {
        try
        {
            Guid g = new Guid(guidString);
            return true;
        }
        catch
        {
            return false;
        }
    }

    public static Guid StringToGuid(string possibleGuid)
    {
        Guid g;
        g = GuidExt.ZeroGuid();
        if (!String.IsNullOrEmpty(possibleGuid))
        {
            try
            {
                g = new Guid(possibleGuid);
            }
            finally
            {
            }
        }
        return g;
    }
}
